/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package medicalassistant;
import java.awt.*;
import java.sql.*;
import javax.swing.table.*;
import javax.swing.event.*;
import java.text.*;
/**
 *
 * @author haozhang
 */
public class ManagePatient extends javax.swing.JPanel {

    /**
     * Creates new form ManagePatients
     */
    public ManagePatient(int ID, int userType, Connection connect) {
        initComponents();
        selectedPatient = -1;
        int doctorGetID;
        try {
            Class.forName("org.sqlite.JDBC");
            conn = connect;
            stat = conn.createStatement();
            System.out.println("SQLite connection successful!");
            ResultSet patientRS;
            if (userType == 2)
                patientRS = stat.executeQuery("SELECT * FROM patients WHERE doctorID = '" + ID + "';");
            else if (userType == 1) {
                patientRS = stat.executeQuery("SELECT doctorID FROM nurses WHERE uid = '" + ID + "';");
                doctorGetID = patientRS.getInt("doctorID");
                patientRS = stat.executeQuery("SELECT * FROM patients WHERE doctorID = '" + doctorGetID + "';");
            }
            else
                patientRS = stat.executeQuery("SELECT * FROM patients;");
            DefaultTableModel patientModel = (DefaultTableModel) patientList.getModel();
            while (patientRS.next()) {
                patientModel.addRow(new Object[]{patientRS.getString(3), patientRS.getString(2), patientRS.getString(1)});
            }
        } catch(ClassNotFoundException ex) {System.out.println(ex.getMessage());}
        catch(SQLException ex) {System.out.println(ex.getMessage());}
        
        patientList.getSelectionModel().addListSelectionListener(
        new ListSelectionListener() {
            @Override
            public void valueChanged(ListSelectionEvent event) {
                int rowSelected = patientList.getSelectedRow();
                if (rowSelected < 0) {
                    patientName.setText("[no patient selected]");
                    address.setText("");
                    birth.setText("");
                    city.setText("");
                    firstName.setText("");
                    insurance.setText("");
                    insuranceID.setText("");
                    lastName.setText("");
                    ssn.setText("");
                    state.setText("");
                    zip.setText("");
                    sex.setSelectedItem("--");
                    title.setSelectedItem("--");
                    doctorID.setText("");
                }
                else {
                    TableModel model = patientList.getModel();
                    selectedPatient = Integer.parseInt((String)model.getValueAt(rowSelected, 2));
                    System.out.println("Selected patient ID " + selectedPatient);
                    try {
                        ResultSet patientInfo = stat.executeQuery("SELECT * FROM patients WHERE uid = '" + selectedPatient + "';");
                        patientName.setText(patientInfo.getString("first") + " " + patientInfo.getString("last") + " [" + selectedPatient + "]");
                        address.setText(patientInfo.getString("address"));
                        SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
                        birth.setText(df.format(patientInfo.getDate("birthdate")));
                        city.setText(patientInfo.getString("city"));
                        firstName.setText(patientInfo.getString("first"));
                        insurance.setText(patientInfo.getString("insurance"));
                        insuranceID.setText(patientInfo.getString("insuranceID"));
                        lastName.setText(patientInfo.getString("last"));
                        ssn.setText(patientInfo.getString("ssn"));
                        state.setText(patientInfo.getString("state"));
                        zip.setText(patientInfo.getString("zip"));
                        sex.setSelectedItem(patientInfo.getString("sex"));
                        title.setSelectedItem(patientInfo.getString("title"));
                        doctorID.setText(patientInfo.getString("doctorID"));
                    } catch (SQLException ex) {System.out.println(ex.getMessage());}
                }
                emptyError.setText("");
            }
        });
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        patientListPanel = new javax.swing.JPanel();
        jScrollPane = new javax.swing.JScrollPane();
        patientList = new javax.swing.JTable();
        patientListHeader = new javax.swing.JLabel();
        patientInfoPanel = new javax.swing.JPanel();
        patientHeader = new javax.swing.JPanel();
        patientName = new javax.swing.JLabel();
        infoSelecter = new javax.swing.JComboBox();
        patientCardPanel = new javax.swing.JPanel();
        personal = new javax.swing.JPanel();
        jLabel3 = new javax.swing.JLabel();
        firstName = new javax.swing.JTextField();
        lastName = new javax.swing.JTextField();
        jLabel5 = new javax.swing.JLabel();
        title = new javax.swing.JComboBox();
        jLabel6 = new javax.swing.JLabel();
        sex = new javax.swing.JComboBox();
        jLabel8 = new javax.swing.JLabel();
        city = new javax.swing.JTextField();
        jLabel9 = new javax.swing.JLabel();
        state = new javax.swing.JTextField();
        zip = new javax.swing.JTextField();
        jLabel10 = new javax.swing.JLabel();
        jLabel7 = new javax.swing.JLabel();
        jLabel12 = new javax.swing.JLabel();
        ssn = new javax.swing.JTextField();
        jLabel11 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        jScrollPane1 = new javax.swing.JScrollPane();
        address = new javax.swing.JTextArea();
        birth = new javax.swing.JTextField();
        jLabel13 = new javax.swing.JLabel();
        insurance = new javax.swing.JTextField();
        jLabel14 = new javax.swing.JLabel();
        insuranceID = new javax.swing.JTextField();
        jPanel1 = new javax.swing.JPanel();
        saveButton = new javax.swing.JButton();
        cancelButton = new javax.swing.JButton();
        doctorID = new javax.swing.JTextField();
        jLabel1 = new javax.swing.JLabel();
        emptyError = new javax.swing.JLabel();
        birthError = new javax.swing.JLabel();
        medical = new javax.swing.JPanel();
        medicalFields = new javax.swing.JPanel();
        entryDate = new javax.swing.JLabel();
        entryAuthor = new javax.swing.JLabel();
        jLabel21 = new javax.swing.JLabel();
        weight = new javax.swing.JTextField();
        jLabel20 = new javax.swing.JLabel();
        height = new javax.swing.JTextField();
        jLabel17 = new javax.swing.JLabel();
        bmi = new javax.swing.JTextField();
        jScrollPane2 = new javax.swing.JScrollPane();
        prescriptions = new javax.swing.JTextArea();
        jLabel19 = new javax.swing.JLabel();
        jLabel24 = new javax.swing.JLabel();
        jLabel22 = new javax.swing.JLabel();
        systolic = new javax.swing.JTextField();
        jLabel23 = new javax.swing.JLabel();
        diastolic = new javax.swing.JTextField();
        jLabel18 = new javax.swing.JLabel();
        bloodsugar = new javax.swing.JTextField();
        jLabel16 = new javax.swing.JLabel();
        notesPanel = new javax.swing.JPanel();
        jLabel15 = new javax.swing.JLabel();
        jScrollPane4 = new javax.swing.JScrollPane();
        medicalNotes = new javax.swing.JTextArea();
        saveMedicalButton = new javax.swing.JButton();
        medicalEntryListPanel = new javax.swing.JPanel();
        jScrollPane3 = new javax.swing.JScrollPane();
        medicalEntryList = new javax.swing.JTable();
        patientLog = new javax.swing.JPanel();
        jScrollPane5 = new javax.swing.JScrollPane();
        logList = new javax.swing.JTable();
        commentsPanel = new javax.swing.JPanel();
        commentsLabel = new javax.swing.JLabel();
        jScrollPane6 = new javax.swing.JScrollPane();
        comments = new javax.swing.JTextArea();

        setLayout(new java.awt.BorderLayout());

        patientList.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "Last Name", "First Name", "ID"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.String.class, java.lang.String.class, java.lang.Integer.class
            };
            boolean[] canEdit = new boolean [] {
                false, false, false
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        patientList.setCellSelectionEnabled(false);
        patientList.setRowSelectionAllowed(true);
        patientList.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
        jScrollPane.setViewportView(patientList);

        patientListHeader.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N
        patientListHeader.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        patientListHeader.setText("Patient List");
        patientListHeader.setToolTipText("");
        patientListHeader.setName(""); // NOI18N

        javax.swing.GroupLayout patientListPanelLayout = new javax.swing.GroupLayout(patientListPanel);
        patientListPanel.setLayout(patientListPanelLayout);
        patientListPanelLayout.setHorizontalGroup(
            patientListPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(patientListPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(patientListPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(jScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 300, Short.MAX_VALUE)
                    .addComponent(patientListHeader, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        patientListPanelLayout.setVerticalGroup(
            patientListPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(patientListPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(patientListHeader)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 512, Short.MAX_VALUE)
                .addContainerGap())
        );

        add(patientListPanel, java.awt.BorderLayout.WEST);

        patientInfoPanel.setLayout(new java.awt.BorderLayout());

        patientName.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N
        patientName.setText("[no patient selected]");

        infoSelecter.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Personal", "Medical", "Patient Log" }));
        infoSelecter.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                infoSelecterItemStateChanged(evt);
            }
        });
        infoSelecter.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                infoSelecterActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout patientHeaderLayout = new javax.swing.GroupLayout(patientHeader);
        patientHeader.setLayout(patientHeaderLayout);
        patientHeaderLayout.setHorizontalGroup(
            patientHeaderLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(patientHeaderLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(patientName)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 197, Short.MAX_VALUE)
                .addComponent(infoSelecter, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );
        patientHeaderLayout.setVerticalGroup(
            patientHeaderLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(patientHeaderLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(patientHeaderLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(patientName)
                    .addComponent(infoSelecter, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        patientInfoPanel.add(patientHeader, java.awt.BorderLayout.NORTH);

        patientCardPanel.setLayout(new java.awt.CardLayout());

        jLabel3.setText("First Name:");

        jLabel5.setText("Title:");

        title.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "--", "Mr.", "Mrs.", "Ms.", "Miss.", "Master" }));
        title.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                titleActionPerformed(evt);
            }
        });

        jLabel6.setText("Sex:");

        sex.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "--", "Male", "Female", "Other" }));

        jLabel8.setText("City:");

        jLabel9.setText("State:");

        jLabel10.setText("Zip:");

        jLabel7.setText("Address:");

        jLabel12.setText("Birthdate:");

        jLabel11.setText("SSN:");

        jLabel4.setText("Last Name:");

        jScrollPane1.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER);

        address.setColumns(20);
        address.setRows(5);
        jScrollPane1.setViewportView(address);

        jLabel13.setText("Insurance Company:");

        jLabel14.setText("Insurance ID:");

        saveButton.setText("Save");
        saveButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                saveButtonActionPerformed(evt);
            }
        });
        jPanel1.add(saveButton);

        cancelButton.setText("Cancel");
        cancelButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                cancelButtonActionPerformed(evt);
            }
        });
        jPanel1.add(cancelButton);

        jLabel1.setText("Doctor ID:");

        emptyError.setText(" ");

        birthError.setText(" ");

        javax.swing.GroupLayout personalLayout = new javax.swing.GroupLayout(personal);
        personal.setLayout(personalLayout);
        personalLayout.setHorizontalGroup(
            personalLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(personalLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(personalLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(personalLayout.createSequentialGroup()
                        .addGroup(personalLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jLabel3)
                            .addComponent(jLabel4)
                            .addComponent(jLabel7)
                            .addComponent(jLabel8)
                            .addComponent(jLabel10)
                            .addComponent(jLabel12)
                            .addComponent(jLabel13)
                            .addComponent(jLabel1))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(personalLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addGroup(personalLayout.createSequentialGroup()
                                .addGroup(personalLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                    .addGroup(personalLayout.createSequentialGroup()
                                        .addComponent(firstName, javax.swing.GroupLayout.PREFERRED_SIZE, 180, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addGap(18, 18, 18)
                                        .addComponent(jLabel5))
                                    .addGroup(personalLayout.createSequentialGroup()
                                        .addComponent(lastName, javax.swing.GroupLayout.PREFERRED_SIZE, 180, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                        .addComponent(jLabel6)))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addGroup(personalLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(title, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(sex, 0, 102, Short.MAX_VALUE)))
                            .addGroup(personalLayout.createSequentialGroup()
                                .addGroup(personalLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(personalLayout.createSequentialGroup()
                                        .addGroup(personalLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                            .addComponent(birth, javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(zip)
                                            .addComponent(city, javax.swing.GroupLayout.DEFAULT_SIZE, 120, Short.MAX_VALUE)
                                            .addComponent(insurance, javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(doctorID))
                                        .addGroup(personalLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                            .addGroup(javax.swing.GroupLayout.Alignment.LEADING, personalLayout.createSequentialGroup()
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                                .addGroup(personalLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                    .addComponent(jLabel9, javax.swing.GroupLayout.Alignment.TRAILING)
                                                    .addComponent(jLabel11, javax.swing.GroupLayout.Alignment.TRAILING))
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                .addGroup(personalLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                    .addComponent(ssn, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 120, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                    .addComponent(state, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 120, javax.swing.GroupLayout.PREFERRED_SIZE)))
                                            .addGroup(javax.swing.GroupLayout.Alignment.LEADING, personalLayout.createSequentialGroup()
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                .addGroup(personalLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                    .addComponent(birthError)
                                                    .addGroup(personalLayout.createSequentialGroup()
                                                        .addComponent(jLabel14)
                                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                        .addComponent(insuranceID, javax.swing.GroupLayout.PREFERRED_SIZE, 120, javax.swing.GroupLayout.PREFERRED_SIZE))))))
                                    .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 300, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(emptyError))
                                .addGap(14, 14, 14)))))
                .addContainerGap(15, Short.MAX_VALUE))
        );
        personalLayout.setVerticalGroup(
            personalLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(personalLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(emptyError)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(personalLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel3)
                    .addComponent(firstName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel5)
                    .addComponent(title, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(personalLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(lastName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel4)
                    .addComponent(sex, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel6))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(personalLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel7)
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 83, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(personalLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(city, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel8)
                    .addComponent(jLabel9)
                    .addComponent(state, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(personalLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(zip, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel10)
                    .addComponent(ssn, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel11))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(personalLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel12)
                    .addComponent(birth, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(birthError))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(personalLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel13)
                    .addComponent(insurance, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel14)
                    .addComponent(insuranceID, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(personalLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(doctorID, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel1))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(181, Short.MAX_VALUE))
        );

        patientCardPanel.add(personal, "Personal");

        medical.setLayout(new java.awt.BorderLayout());

        entryDate.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N
        entryDate.setText("2012-12-24");

        entryAuthor.setText("Added by Burger Paul [1414]");

        jLabel21.setText("Weight (kg):");

        jLabel20.setText("Height (cm):");

        jLabel17.setText("BMI:");

        jScrollPane2.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER);

        prescriptions.setColumns(20);
        prescriptions.setRows(5);
        jScrollPane2.setViewportView(prescriptions);

        jLabel19.setText("Prescriptions:");

        jLabel24.setText("Blood Pressure:");

        jLabel22.setText("Systolic:");

        jLabel23.setText("Diastolic:");

        jLabel18.setText("Blood Sugar:");

        jLabel16.setText("mmol/L");

        javax.swing.GroupLayout medicalFieldsLayout = new javax.swing.GroupLayout(medicalFields);
        medicalFields.setLayout(medicalFieldsLayout);
        medicalFieldsLayout.setHorizontalGroup(
            medicalFieldsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(medicalFieldsLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(medicalFieldsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(medicalFieldsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                        .addGroup(medicalFieldsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addGroup(medicalFieldsLayout.createSequentialGroup()
                                .addComponent(entryDate)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addComponent(entryAuthor))
                            .addGroup(medicalFieldsLayout.createSequentialGroup()
                                .addComponent(jLabel21)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(weight, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(18, 18, 18)
                                .addComponent(jLabel20)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(height, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(18, 18, 18)
                                .addComponent(jLabel17)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(bmi, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)))
                        .addGroup(medicalFieldsLayout.createSequentialGroup()
                            .addGroup(medicalFieldsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                .addComponent(jLabel19)
                                .addComponent(jLabel22)
                                .addComponent(jLabel18))
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addGroup(medicalFieldsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 365, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGroup(medicalFieldsLayout.createSequentialGroup()
                                    .addGroup(medicalFieldsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                        .addComponent(bloodsugar, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 80, Short.MAX_VALUE)
                                        .addComponent(systolic, javax.swing.GroupLayout.Alignment.LEADING))
                                    .addGap(18, 18, 18)
                                    .addGroup(medicalFieldsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addGroup(medicalFieldsLayout.createSequentialGroup()
                                            .addComponent(jLabel23)
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                            .addComponent(diastolic, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE))
                                        .addComponent(jLabel16))))))
                    .addComponent(jLabel24))
                .addContainerGap(15, Short.MAX_VALUE))
        );
        medicalFieldsLayout.setVerticalGroup(
            medicalFieldsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(medicalFieldsLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(medicalFieldsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(entryDate)
                    .addComponent(entryAuthor))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(medicalFieldsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel21)
                    .addComponent(weight, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel20)
                    .addComponent(height, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel17)
                    .addComponent(bmi, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(medicalFieldsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel19)
                    .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel24)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(medicalFieldsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(systolic, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel22)
                    .addComponent(jLabel23)
                    .addComponent(diastolic, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(medicalFieldsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel18)
                    .addComponent(bloodsugar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel16))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        medical.add(medicalFields, java.awt.BorderLayout.CENTER);

        jLabel15.setText("Doctor's Notes:");

        jScrollPane4.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER);

        medicalNotes.setColumns(20);
        medicalNotes.setRows(5);
        jScrollPane4.setViewportView(medicalNotes);

        saveMedicalButton.setText("Save");
        saveMedicalButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                saveMedicalButtonActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout notesPanelLayout = new javax.swing.GroupLayout(notesPanel);
        notesPanel.setLayout(notesPanelLayout);
        notesPanelLayout.setHorizontalGroup(
            notesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(notesPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(notesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(saveMedicalButton)
                    .addGroup(notesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addComponent(jLabel15)
                        .addComponent(jScrollPane4, javax.swing.GroupLayout.PREFERRED_SIZE, 350, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(99, Short.MAX_VALUE))
        );
        notesPanelLayout.setVerticalGroup(
            notesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(notesPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel15)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane4, javax.swing.GroupLayout.PREFERRED_SIZE, 77, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(saveMedicalButton)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        medical.add(notesPanel, java.awt.BorderLayout.SOUTH);

        medicalEntryList.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "Date", "Summary"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.String.class, java.lang.String.class
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }
        });
        medicalEntryList.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
        jScrollPane3.setViewportView(medicalEntryList);

        javax.swing.GroupLayout medicalEntryListPanelLayout = new javax.swing.GroupLayout(medicalEntryListPanel);
        medicalEntryListPanel.setLayout(medicalEntryListPanelLayout);
        medicalEntryListPanelLayout.setHorizontalGroup(
            medicalEntryListPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane3, javax.swing.GroupLayout.DEFAULT_SIZE, 459, Short.MAX_VALUE)
        );
        medicalEntryListPanelLayout.setVerticalGroup(
            medicalEntryListPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 140, javax.swing.GroupLayout.PREFERRED_SIZE)
        );

        medical.add(medicalEntryListPanel, java.awt.BorderLayout.NORTH);

        patientCardPanel.add(medical, "Medical");

        patientLog.setLayout(new java.awt.GridLayout(2, 1));

        logList.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "Date", "Blood Pressure", "Blood Sugar", "Comments"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.Object.class
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }
        });
        jScrollPane5.setViewportView(logList);

        patientLog.add(jScrollPane5);

        commentsLabel.setText("Comments:");

        comments.setColumns(20);
        comments.setRows(5);
        jScrollPane6.setViewportView(comments);

        javax.swing.GroupLayout commentsPanelLayout = new javax.swing.GroupLayout(commentsPanel);
        commentsPanel.setLayout(commentsPanelLayout);
        commentsPanelLayout.setHorizontalGroup(
            commentsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(commentsPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(commentsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(commentsPanelLayout.createSequentialGroup()
                        .addComponent(commentsLabel)
                        .addGap(0, 0, Short.MAX_VALUE))
                    .addComponent(jScrollPane6, javax.swing.GroupLayout.DEFAULT_SIZE, 439, Short.MAX_VALUE))
                .addContainerGap())
        );
        commentsPanelLayout.setVerticalGroup(
            commentsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(commentsPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(commentsLabel)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane6, javax.swing.GroupLayout.DEFAULT_SIZE, 216, Short.MAX_VALUE)
                .addContainerGap())
        );

        patientLog.add(commentsPanel);

        patientCardPanel.add(patientLog, "Patient Log");

        patientInfoPanel.add(patientCardPanel, java.awt.BorderLayout.CENTER);

        add(patientInfoPanel, java.awt.BorderLayout.CENTER);
    }// </editor-fold>//GEN-END:initComponents

    private void cancelButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cancelButtonActionPerformed
        // revert back to original
        if (selectedPatient < 0) {
            address.setText("");
            birth.setText("");
            city.setText("");
            firstName.setText("");
            insurance.setText("");
            insuranceID.setText("");
            lastName.setText("");
            ssn.setText("");
            state.setText("");
            zip.setText("");
            sex.setSelectedItem("--");
            title.setSelectedItem("--");
            doctorID.setText("");
            emptyError.setText("");
        }
        else {
            try {
                ResultSet patientInfo = stat.executeQuery("SELECT * FROM patients WHERE uid = '" + selectedPatient + "';");
                patientName.setText(patientInfo.getString("first") + " " + patientInfo.getString("last") + " [" + selectedPatient + "]");
                address.setText(patientInfo.getString("address"));
                SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
                birth.setText(df.format(patientInfo.getDate("birthdate")));
                city.setText(patientInfo.getString("city"));
                firstName.setText(patientInfo.getString("first"));
                insurance.setText(patientInfo.getString("insurance"));
                insuranceID.setText(patientInfo.getString("insuranceID"));
                lastName.setText(patientInfo.getString("last"));
                ssn.setText(patientInfo.getString("ssn"));
                state.setText(patientInfo.getString("state"));
                zip.setText(patientInfo.getString("zip"));
                sex.setSelectedItem(patientInfo.getString("sex"));
                title.setSelectedItem(patientInfo.getString("title"));
                doctorID.setText(patientInfo.getString("doctorID"));
                emptyError.setText("");
            } catch (SQLException ex) {System.out.println(ex.getMessage());}
        }
    }//GEN-LAST:event_cancelButtonActionPerformed

    private void infoSelecterActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_infoSelecterActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_infoSelecterActionPerformed

    private void infoSelecterItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_infoSelecterItemStateChanged
        Object src = evt.getSource();
        CardLayout card = (CardLayout) patientCardPanel.getLayout();
        card.show(patientCardPanel, (String)evt.getItem());
    }//GEN-LAST:event_infoSelecterItemStateChanged

    private void titleActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_titleActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_titleActionPerformed

    private void saveMedicalButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_saveMedicalButtonActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_saveMedicalButtonActionPerformed

    private void saveButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_saveButtonActionPerformed
        String sexString = (String) sex.getSelectedItem();
        String titleString = (String) title.getSelectedItem();
        if (!address.getText().isEmpty() 
                && !birth.getText().isEmpty() 
                && !city.getText().isEmpty() 
                && !firstName.getText().isEmpty()
                && !lastName.getText().isEmpty()
                && !ssn.getText().isEmpty()
                && !state.getText().isEmpty()
                && !zip.getText().isEmpty()
                && !sexString.equals("--")
                && !titleString.equals("--")
                && !doctorID.getText().isEmpty()
                && !insurance.getText().isEmpty()
                && !insuranceID.getText().isEmpty()
                && selectedPatient > 0) {
            try {
                // Parse Birthdate
                SimpleDateFormat sdfm = new SimpleDateFormat("yyyy-MM-dd");
                java.util.Date date = sdfm.parse((String)birth.getText());
                java.sql.Date sqlDate = new Date(date.getTime());
                emptyError.setText("Patient successfully updated.");
                stat.executeQuery("UPDATE patients SET "
                        + " address = '" + address.getText()
                        + "', birthdate = " + sqlDate
                        + ", city = '" + city.getText()
                        + "', first = '" + firstName.getText()
                        + "', last = '" + lastName.getText()
                        + "', ssn = " + ssn.getText()
                        + ", state = '" + state.getText()
                        + "', zip = " + zip.getText()
                        + ", sex = '" + sexString
                        + "', title = '" + titleString
                        + "', doctorID = " + doctorID.getText()
                        + ", insurance = '" + insurance.getText()
                        + "', insuranceID = '" + insuranceID.getText()
                        + "' WHERE uid = " + selectedPatient);
            } catch (SQLException ex) {System.out.println(ex.getMessage());}
            catch (ParseException ex) {birthError.setText("You must format your birthdate in this format: YYYY-MM-DD");}
        }
        else
            emptyError.setText("ERROR: You must fill in ALL the fields.");
    }//GEN-LAST:event_saveButtonActionPerformed
    // SQLite Variable declaration
    private Connection conn;
    private Statement stat;
    private int selectedPatient;
    // End of SQLite Variable declaration
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JTextArea address;
    private javax.swing.JTextField birth;
    private javax.swing.JLabel birthError;
    private javax.swing.JTextField bloodsugar;
    private javax.swing.JTextField bmi;
    private javax.swing.JButton cancelButton;
    private javax.swing.JTextField city;
    private javax.swing.JTextArea comments;
    private javax.swing.JLabel commentsLabel;
    private javax.swing.JPanel commentsPanel;
    private javax.swing.JTextField diastolic;
    private javax.swing.JTextField doctorID;
    private javax.swing.JLabel emptyError;
    private javax.swing.JLabel entryAuthor;
    private javax.swing.JLabel entryDate;
    private javax.swing.JTextField firstName;
    private javax.swing.JTextField height;
    private javax.swing.JComboBox infoSelecter;
    private javax.swing.JTextField insurance;
    private javax.swing.JTextField insuranceID;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel14;
    private javax.swing.JLabel jLabel15;
    private javax.swing.JLabel jLabel16;
    private javax.swing.JLabel jLabel17;
    private javax.swing.JLabel jLabel18;
    private javax.swing.JLabel jLabel19;
    private javax.swing.JLabel jLabel20;
    private javax.swing.JLabel jLabel21;
    private javax.swing.JLabel jLabel22;
    private javax.swing.JLabel jLabel23;
    private javax.swing.JLabel jLabel24;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JScrollPane jScrollPane;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JScrollPane jScrollPane3;
    private javax.swing.JScrollPane jScrollPane4;
    private javax.swing.JScrollPane jScrollPane5;
    private javax.swing.JScrollPane jScrollPane6;
    private javax.swing.JTextField lastName;
    private javax.swing.JTable logList;
    private javax.swing.JPanel medical;
    private javax.swing.JTable medicalEntryList;
    private javax.swing.JPanel medicalEntryListPanel;
    private javax.swing.JPanel medicalFields;
    private javax.swing.JTextArea medicalNotes;
    private javax.swing.JPanel notesPanel;
    private javax.swing.JPanel patientCardPanel;
    private javax.swing.JPanel patientHeader;
    private javax.swing.JPanel patientInfoPanel;
    private javax.swing.JTable patientList;
    private javax.swing.JLabel patientListHeader;
    private javax.swing.JPanel patientListPanel;
    private javax.swing.JPanel patientLog;
    private javax.swing.JLabel patientName;
    private javax.swing.JPanel personal;
    private javax.swing.JTextArea prescriptions;
    private javax.swing.JButton saveButton;
    private javax.swing.JButton saveMedicalButton;
    private javax.swing.JComboBox sex;
    private javax.swing.JTextField ssn;
    private javax.swing.JTextField state;
    private javax.swing.JTextField systolic;
    private javax.swing.JComboBox title;
    private javax.swing.JTextField weight;
    private javax.swing.JTextField zip;
    // End of variables declaration//GEN-END:variables
}
